import { Action } from "@ngrx/store";
import {
  ISelectAssetsResponse,
  ISelectAssetsRequest,
  ISelectCoinConfigRequest,
  ISelectCoinConfigResponse,
  IFindAssetsRequest,
  IFindAssetsResponse,
  IWithdrawRequest,
  IWithdrawResponse,
  ISelectDepositHistoryRequest,
  ISelectDepositHistoryResponse,
  ISelectWithdrawHistoryRequest,
  ISelectWithdrawHistoryResponse,
  IAddAddressRequest,
  IAddAddressResponse,
  IDelAddressRequest,
  IDelAddressResponse,
  ISelectWithdrawAddressRequest,
  ISelectWithdrawAddressResponse,
  IFindDepositAddressRequest,
  IFindDepositAddressResponse,
  IFindAssetsToBtcRequest,
  IFindAssetsToBtcResponse
} from "../models/assets";
export enum AssetsActionTypes {
  SelectAssets = "[Assets] SelectAssets",
  SelectAssetsSuccess = "[Assets] Select Assets Success",
  SelectAssetsError = "[Assets] Select Assets Error",

  SelectCoinConfig = "[Assets] Select Coin Config ",
  SelectCoinConfigSuccess = "[Assets] Select Coin Config  Success",
  SelectCoinConfigError = "[Assets] Select Coin Config  Error",

  FindAssets = "[Assets] Find Assets",
  FindAssetsSuccess = "[Assets] Find Assets  Success",
  FindAssetsError = "[Assets] Find Assets  Error",

  Withdraw = "[Assets] Withdraw",
  WithdrawSuccess = "[Assets] Withdraw  Success",
  WithdrawError = "[Assets] Withdraw  Error",

  SelectDepositHistory = "[Assets] Select Deposit History",
  SelectDepositHistorySuccess = "[Assets] Select Deposit History Success",
  SelectDepositHistoryError = "[Assets] Select Deposit History Error",

  SelectWithdrawHistory = "[Assets] Select Withdraw History",
  SelectWithdrawHistorySuccess = "[Assets] Select Withdraw History Success",
  SelectWithdrawHistoryError = "[Assets] Select Withdraw History Error",

  AddAddress = "[Assets] AddAddress",
  AddAddressSuccess = "[Assets] AddAddress Success",
  AddAddressError = "[Assets] AddAddress Error",

  DelAddress = "[Assets] DelAddress",
  DelAddressSuccess = "[Assets] DelAddress Success",
  DelAddressError = "[Assets] DelAddress Error",

  FindDepositAddress = "[Assets] Find Deposit Address",
  FindDepositAddressSuccess = "[Assets] Find Deposit Address Success",
  FindDepositAddressError = "[Assets] Find Deposit Address Error",

  SelectWithdrawAddress = "[Assets] Select Address",
  SelectWithdrawAddressSuccess = "[Assets] Select Address Success",
  SelectWithdrawAddressError = "[Assets] Select Address Error",

  FindAssetsToBtc = "[Assets] FindAssetsToBtc",
  FindAssetsToBtcSuccess = "[Assets] FindAssetsToBtc Success",
  FindAssetsToBtcError = "[Assets] FindAssetsToBtc Error"
}

export class SelectAssets implements Action {
  readonly type = AssetsActionTypes.SelectAssets;
  constructor(public payload: { req: ISelectAssetsRequest }) {}
}

export class SelectAssetsSuccess implements Action {
  readonly type = AssetsActionTypes.SelectAssetsSuccess;
  constructor(public payload: { res: ISelectAssetsResponse }) {}
}

export class SelectAssetsError implements Action {
  readonly type = AssetsActionTypes.SelectAssetsError;
  constructor(public payload: { error: any }) {}
}

export class SelectCoinConfig implements Action {
  readonly type = AssetsActionTypes.SelectCoinConfig;
  constructor(public payload: { req: ISelectCoinConfigRequest }) {}
}

export class SelectCoinConfigSuccess implements Action {
  readonly type = AssetsActionTypes.SelectCoinConfigSuccess;
  constructor(public payload: { res: ISelectCoinConfigResponse }) {}
}

export class SelectCoinConfigError implements Action {
  readonly type = AssetsActionTypes.SelectCoinConfigError;
  constructor(public payload: { error: any }) {}
}

export class FindAssets implements Action {
  readonly type = AssetsActionTypes.FindAssets;
  constructor(public payload: { req: IFindAssetsRequest }) {}
}

export class FindAssetsSuccess implements Action {
  readonly type = AssetsActionTypes.FindAssetsSuccess;
  constructor(public payload: { res: IFindAssetsResponse }) {}
}

export class FindAssetsError implements Action {
  readonly type = AssetsActionTypes.FindAssetsError;
  constructor(public payload: { error: any }) {}
}

export class FindAssetsToBtc implements Action {
  readonly type = AssetsActionTypes.FindAssetsToBtc;
  constructor(public payload: { req: IFindAssetsToBtcRequest }) {}
}

export class FindAssetsToBtcSuccess implements Action {
  readonly type = AssetsActionTypes.FindAssetsToBtcSuccess;
  constructor(public payload: { res: IFindAssetsToBtcResponse }) {}
}

export class FindAssetsToBtcError implements Action {
  readonly type = AssetsActionTypes.FindAssetsToBtcError;
  constructor(public payload: { error: any }) {}
}

export class Withdraw implements Action {
  readonly type = AssetsActionTypes.Withdraw;
  constructor(public payload: { req: IWithdrawRequest; cpt: any }) {}
}

export class WithdrawSuccess implements Action {
  readonly type = AssetsActionTypes.WithdrawSuccess;
  constructor(public payload: { res: IWithdrawResponse; cpt: any }) {}
}

export class WithdrawError implements Action {
  readonly type = AssetsActionTypes.WithdrawError;
  constructor(public payload: { error: any }) {}
}

export class SelectDepositHistory implements Action {
  readonly type = AssetsActionTypes.SelectDepositHistory;
  constructor(
    public payload: { req: ISelectDepositHistoryRequest; cpt: any }
  ) {}
}

export class SelectDepositHistorySuccess implements Action {
  readonly type = AssetsActionTypes.SelectDepositHistorySuccess;
  constructor(
    public payload: { res: ISelectDepositHistoryResponse; cpt: any }
  ) {}
}

export class SelectDepositHistoryError implements Action {
  readonly type = AssetsActionTypes.SelectDepositHistoryError;
  constructor(public payload: { error: any }) {}
}

export class SelectWithdrawHistory implements Action {
  readonly type = AssetsActionTypes.SelectWithdrawHistory;
  constructor(
    public payload: { req: ISelectWithdrawHistoryRequest; cpt: any }
  ) {}
}

export class SelectWithdrawHistorySuccess implements Action {
  readonly type = AssetsActionTypes.SelectWithdrawHistorySuccess;
  constructor(
    public payload: { res: ISelectWithdrawHistoryResponse; cpt: any }
  ) {}
}

export class SelectWithdrawHistoryError implements Action {
  readonly type = AssetsActionTypes.SelectWithdrawHistoryError;
  constructor(public payload: { error: any }) {}
}

export class AddAddress implements Action {
  readonly type = AssetsActionTypes.AddAddress;
  constructor(public payload: { req: IAddAddressRequest; cpt: any }) {}
}

export class AddAddressSuccess implements Action {
  readonly type = AssetsActionTypes.AddAddressSuccess;
  constructor(public payload: { res: IAddAddressResponse; cpt: any }) {}
}

export class AddAddressError implements Action {
  readonly type = AssetsActionTypes.AddAddressError;
  constructor(public payload: { error: any }) {}
}

export class DelAddress implements Action {
  readonly type = AssetsActionTypes.DelAddress;
  constructor(public payload: { req: IDelAddressRequest; cpt: any }) {}
}

export class DelAddressSuccess implements Action {
  readonly type = AssetsActionTypes.DelAddressSuccess;
  constructor(public payload: { res: IDelAddressResponse; cpt: any }) {}
}

export class DelAddressError implements Action {
  readonly type = AssetsActionTypes.DelAddressError;
  constructor(public payload: { error: any }) {}
}

export class SelectWithdrawAddress implements Action {
  readonly type = AssetsActionTypes.SelectWithdrawAddress;
  constructor(
    public payload: { req: ISelectWithdrawAddressRequest; cpt: any }
  ) {}
}

export class SelectWithdrawAddressSuccess implements Action {
  readonly type = AssetsActionTypes.SelectWithdrawAddressSuccess;
  constructor(
    public payload: { res: ISelectWithdrawAddressResponse; cpt: any }
  ) {}
}

export class SelectWithdrawAddressError implements Action {
  readonly type = AssetsActionTypes.SelectWithdrawAddressError;
  constructor(public payload: { error: any }) {}
}

export class FindDepositAddress implements Action {
  readonly type = AssetsActionTypes.FindDepositAddress;
  constructor(public payload: { req: IFindDepositAddressRequest; cpt: any }) {}
}

export class FindDepositAddressSuccess implements Action {
  readonly type = AssetsActionTypes.FindDepositAddressSuccess;
  constructor(public payload: { res: IFindDepositAddressResponse; cpt: any }) {}
}

export class FindDepositAddressError implements Action {
  readonly type = AssetsActionTypes.FindDepositAddressError;
  constructor(public payload: { error: any }) {}
}

export type AssetsActionsUnion =
  | FindDepositAddressError
  | FindDepositAddressSuccess
  | FindDepositAddress
  | SelectWithdrawAddressError
  | SelectWithdrawAddressSuccess
  | SelectWithdrawAddress
  | DelAddressError
  | DelAddressSuccess
  | DelAddress
  | AddAddressError
  | AddAddressSuccess
  | AddAddress
  | SelectWithdrawHistoryError
  | SelectWithdrawHistorySuccess
  | SelectWithdrawHistory
  | SelectDepositHistoryError
  | SelectDepositHistorySuccess
  | SelectDepositHistory
  | Withdraw
  | WithdrawSuccess
  | WithdrawError
  | FindAssetsError
  | FindAssetsSuccess
  | FindAssets
  | FindAssetsToBtcError
  | FindAssetsToBtcSuccess
  | FindAssetsToBtc
  | SelectAssets
  | SelectAssetsSuccess
  | SelectAssetsError
  | SelectCoinConfig
  | SelectCoinConfigSuccess
  | SelectCoinConfigError;
